/**********************************************************************/
/**  Copyright (c) ECC labs. 2001-2002. All Rights Reserved.		 **/
/**********************************************************************/
/*
	binlongm.h
	Mark Papazyan
	
*/

#ifndef __CBINLONGMATRIX_H
#define __CBINLONGMATRIX_H

#include "binlongw.h"
#include "flags.h"


class CBinLongMatrix{
public:


//Variables

	t_len k, n;
	int flag;
	int base;

	CBinLongWord* row;
	CBinLongWord* col;

	t_tab* series;

//Constructors/Destructors

	CBinLongMatrix(t_len k=MAX_LENGTH, t_len n=MAX_HEIGHT, int flag=ROW, int base=BIN);
	CBinLongMatrix(const CBinLongMatrix&);
	~CBinLongMatrix();
	CBinLongMatrix& operator=(const CBinLongMatrix&);	

//Manipulation

	void trans();
	void rowtocol();		
	void coltorow();			
	void cyclic_shift(t_len, char where='r'); 
	void mixer();
	t_res edin(char ch='l');	
	CBinLongWord gaus();				
	CBinLongWord gaus2();
	t_src gaus1();

//Operations

	CBinLongMatrix& operator+=(CBinLongMatrix&);
	CBinLongMatrix operator+(CBinLongMatrix&);	

	CBinLongWord operator*(CBinLongWord&);

	CBinLongMatrix& operator*=(CBinLongMatrix&);	
	CBinLongMatrix operator*(CBinLongMatrix&);

	CBinLongMatrix& operator^=(CBinLongMatrix&);	
	CBinLongMatrix operator^(CBinLongMatrix&);

	CBinLongMatrix& operator^=(CBinLongWord&);
	CBinLongMatrix operator^(CBinLongWord&);

//Manipulation with flag

	void set_row();
	void set_col();
	void set_hcol();
	void set_base(int);
};

//Input/Output

ostream& operator<<(ostream&, CBinLongMatrix&);
istream& operator>>(istream&, CBinLongMatrix&);
/*
//Quick Operators

void add_mat(CBinLongMatrix&, CBinLongMatrix&, CBinLongMatrix&);
void mul_mat(CBinLongMatrix&, CBinLongMatrix&, CBinLongMatrix&);
void mul_vec(CBinLongWord&, CBinLongMatrix&, CBinLongWord&);
void tmul_mat(CBinLongMatrix&, CBinLongMatrix&, CBinLongMatrix&);
void tmul_vec(CBinLongMatrix&, CBinLongMatrix&, CBinLongWord&);*/

#endif
